import DeviceStorage from '../common/DeviceStorage';
export function getUser(){
	return dispatch=>{
    DeviceStorage.get('user').then((user)=>{
      if(user){
        let userInfo = JSON.parse(user);
        dispatch(reciveUserData(userInfo))
      } 
    })
	}
	
}
function reciveUserData(user){
	return {
		type: 'USER_UPDATE_SUCC',
		user
	}
}
function fetchUserData(data) {
	return {
		type: "USER_UPDATE",
		loading: true,
		data: data
	}
}
function fetchUserError() {
	return {
		type: "USER_UPDATE_ERROR"
	}
}